﻿@model DataAccess.Article

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script src="@Url.Content("~/Scripts/tinymce/tinymce.min.js")" type="text/javascript"></script>
    <script src=@Url.Content(string.Format("~/Scripts/backoffice/createpage-min.js")) type="text/javascript"></script>
}

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    <div class="form-horizontal">
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10 save">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
        <div id="article">
            @Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" })
            @Html.HiddenFor(model => model.Id)
        </div>
        <br />
        <br />
        <div class="form-group">
            <div class="col-md-10">
                @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control", placeholder = "Title" } })
                @Html.ValidationMessageFor(model => model.Title, string.Empty, new { @class = "text-danger" })
            </div>
        </div>
        <br />
        <div class="form-group">
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Description, new { htmlAttributes = new { @class = "form-control", placeholder = "Description" } })
                @Html.ValidationMessageFor(model => model.Description, string.Empty, new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group edit-pages">
            <div class="pages-tabs">
                <ul class="tab-links">
                    <li class="tab"><a href="#tab-1">&#x31;</a></li>
                    <li class="plus"><a href="#tabplus">&#x2B;</a></li>
                </ul>
            </div>
            <div class="col-md-10 tab-content">
                <div class="article-page">
                    <div class="page-edit">
                        <div>
                            <div class="save-page">
                                <a class="save-page" href="@Url.Action("CreateArticlePage")"><span class="icon-cloud-upload"></span></a>
                            </div>
                            <div class="delete-page">
                                <span class="icon-bin delete-page"></span>
                            </div>
                        </div>
                        @Html.TextArea("pageContent", new { @class = "content-edit" })
                    </div>
                    <div class="del-confirm">
                        <div class="del-warn">
                            <picture></picture>
                            <div>
                                <span>Do you want to delete this page?</span>
                            </div>
                        </div>
                        <div class="edit-del-butt">
                            <div class="edit-del-ok">
                                @Html.ActionLink("Delete", "DeleteArticlePage", "Article")
                            </div>
                            <div class="edit-del-cancel">
                                <span>Cancel</span>
                            </div>
                        </div>
                    </div>
                    <div class="del-background"></div>
                    <div class="loading hide-loading"><div><span>Saving page content...</span></div></div>
                    <div class="hidden-bloc">
                        <div id="#tab-1" class="active">
                            <div></div>
                            @Html.TextBox("articlePageIds-1")
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
}
